<?php

namespace Admin\Controller;

use Utuo\BackgroundController;

class WechatActivityTypeController extends BackgroundController {
	private $status = array (
			'0' => '关闭',
			'1' => '开启' 
	);
	public function _initialize() {
		$this->setControllerTitle("活动类型管理");
		$this->setActionTitle(array (
				'index' => '活动类型列表',
				'add' => '活动类型添加',
				'modify' => '活动类型修改',
				'recycle' => '回收站' 
		));
		$this->setActionNav("index,add,recycle");
	}
	
	// 获取列表
	public function getLists($is_deleted) {
		$page = $this->getPage();
		$pagesize = $this->getPageSize();
		$lists = M('WechatActivityType')->where('is_deleted=%d',$is_deleted)->limit($pagesize)->page($page)->select();
		$count = M('WechatActivityType')->where('is_deleted=%d',$is_deleted)->count();
		$this->assign('itemLists', $lists);
		$this->showPage($count, $pagesize);
		$this->display();
	}
	
	// 修改
	public function modifyAction($id){
		$item = M('WechatActivityType')->find($id);
		$this->assign('item',$item);
		$this->display('save');
	}
}